Get EOF
The Get EOF command returns an integer that indicates the offset, in bytes, of the end of a specified file from the beginning of the file. It is one of several commands provided by the Read/Write Commands scripting addition. For more information about these commands, see "Using Read/Write Commands,".SYNTAX
get eof referenceToFilePARAMETER
- referenceToFile
- A reference of the form
file
nameString oralias
nameString, or a file reference number returned by a previous call to the Open for Access command (see "Notes").
Class: Reference or integerRESULT
If the command is successful, it returns an integer indicating the offset of the end of the specified file.EXAMPLE
get eof file "Hard Disk:Status Reports:Weekly Report"NOTES
To specify the name (nameString) of a file, use a string of the form"Disk:Folder1:
as described in Chapter 5, "Objects and References,"
Folder2:...:Filename"
of the AppleScript Language Guide. If you specify only the name of the file (Filename) instead of its entire pathname, AppleScript attempts to find the file in the current directory.If you specify a reference to a file or an alias, the Get EOF command attempts to match the reference with a file previously opened with the Open for Access command. (It doesn't matter whether the file was opened with read-only permission or with write permission.) If a match is found, Get EOF returns an integer indicating the offset of the end of the file. If no match is found, Get EOF opens the file, gets the end of the file, then closes the file.
If you specify a file reference number previously obtained with the Open for Access command, the Get EOF command returns a result immediately.
ERRORS
Error
numberError message -38 File <<name>> wasn't open. -50 Parameter error. -51 File reference number error.